import Vue from 'vue';
import axios from 'axios';
let baseURL = !window.baseUrl ? process.env.VUE_APP_BASEURL : window.baseUrl;
const instance = axios.create({ baseURL, timeout: 100000 });

export const chunkSize = 20 * 1024 * 1024;
export const baseParams = { fkId: '', version: '1' };
export const checkUpload = baseURL + 'tbSysAttachment/uploadFile_create';
export const chunkUpload = baseURL + 'tbSysAttachment/uploadFile_par';
export const baseUpload = baseURL + 'tbSysAttachment/upload';

//删除分片上传
export function deleteChunkedUpload(data, headers) {
	return instance({
		url: 'tbSysAttachment/closeFile',
		method: 'post',
		headers,
		data
	})
}
//合并分片文件
export function mergeChunkedUpload(data, headers) {
	return instance({
		url: 'tbSysAttachment/mergeFile',
		method: 'post',
		headers,
		data
	})
}